using System.Data.Entity;
using System;

namespace AesonIntegrationTestLibrary.Tools
{
    public class DatabaseinItializerModel : IDisposable
    {
        public DbContext ctx { get; set; }
        public string BacPacPath { get; set; }
        public string TargetConnectionString { get; set; }
        public string TargetDatabaseName { get; set; }

        public static DatabaseinItializerModel Create(DbContext ctx, string bacpacPath,
            string targetConnectionString, string targetDatabaseName)
        {
            return new DatabaseinItializerModel
            {
                BacPacPath = bacpacPath,
                TargetConnectionString = targetConnectionString,
                TargetDatabaseName = targetDatabaseName,
                ctx = ctx
            };
        }
        public void Dispose()
        {
            if (ctx != null)
            {
                ctx.Dispose();
                ctx = null;
            }
        }

    }
}